#include "remainitem.h"
#include <QPainter>
#include "global/globalvar.h"

RemainItem::RemainItem()
{
}

void RemainItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
    painter->save();

    QFont f("Times [Cronyx]",5);//"Times [Cronyx]", "Palatino". "Helvetica [Cronyx]".
    painter->setFont(f);

    painter->drawText(QRectF(0.0f,0.0f,120.0f,20.0f),
                      Qt::AlignCenter,
                      QString(tr("Remaining grid")));

    painter->drawText(QRectF(0.0f,20.0f,120.0f,20.0f),
                      Qt::AlignCenter,
                      QString("%1").arg(globalvar::m_logic.m_remainNum));

    painter->restore();
}

QRectF RemainItem::boundingRect() const
{
    return QRectF(0.0f,0.0f,120.0f,40.0f);
}
